package com.dzsw.pt.create;

import com.dzsw.runnable.CustomRunnable;

import java.util.concurrent.ThreadFactory;

public class UseFactory {
    public static void main(String[] args) {
        ThreadFactory threadFactory = Thread.ofPlatform().factory();
        Thread thread = threadFactory.newThread(new CustomRunnable());
        thread.start();
        // 主线程结束后，其他线程会运行完成后再释放，不会由于主线程结束而中断执行。
    }
}
